<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="format-detection" content="telephone=yes" />
    <meta name="msapplication-tap-highlight" content="no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>个性定制</title>
	<script type="text/javascript" charset="utf-8" src="common/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="common/js/jquery.jsonp.js"></script>
	<script type="text/javascript" charset="utf-8" src="common/js/common.js"></script>
</head>
<script>
var userAccessCode = getParaValueFromUrl("code");
if(isCanNotAccess(window.localStorage.getItem("wx_openid"))){
	$.jsonp({
		url : "http://sjk.vrdete.com/sjkms/api/user-Wechat-getOpenId.do",
		data : encodeURI("code=" + userAccessCode),
		callbackParameter : "callback",
		timeout : 60000,
		dataFilter : function(json) {
			return json;
		},
		success : function(json, textStatus, xOptions) {
			//alert(JSON.stringify(json));
			if (json.code == 200) {

				if (!isCanNotAccess(json.result.openid)) {
					window.localStorage.setItem("wx_openid",json.result.openid);
					forwardThePageWithUserOpenId();
				}
			} else {
				alert(JSON.stringify(json));
			}

		},
		error : function(xOptions, textStatus) {
			alert(textStatus);
		}
	});					
}else{
	forwardThePageWithUserOpenId();					
}

function forwardThePageWithUserOpenId(){
	window.location="http://sjk.vrdete.com/forward.html?wxuseropenid="+window.localStorage.getItem("wx_openid");
}
</script>
</html>